// Have include guard.
#ifndef ACTIVATABLEMODIFIER_H
#define ACTIVATABLEMODIFIER_H

#include "Modifier.hpp"

template<typename Value>
class ActivatableModifier :
	public Modifier<Value>
{
	private:
		Modifier<Value> &m_modifier;
		bool m_isActive;
	public:
		ActivatableModifier(Modifier<Value> &modifier) :
			m_modifier(modifier),
			m_isActive(false)
		{
		}
		
		void SetIsActive(bool isActive)
		{
			m_isActive = isActive;
		}
		
		/**
		 *  Applies modification to the value if the modifier is active.
		 *  
		 *  @param value The reference to the value desired to be modified.
		 */
		virtual void Modify(Value &value)
		{
			if (m_isActive)
				m_modifier.Modify(value);
		}
};

#endif // #ifndef ACTIVATABLEMODIFIER_H
